int maximum69Number(int num)
{
    char str[100];
    sprintf(str, "%d", num);
    int max_num = num;
    for (int i = 0; str[i] != '\0'; i++)
    {
        char ch = str[i];
        str[i] = ch == '6' ? '9' : '6';
        int tmp_num = atoi(str);
        if (tmp_num > max_num)
            max_num = tmp_num;
        str[i] = ch;
    }
    return max_num;
}